""" This file contains the various functions that generate random names
"""

import random,string

def simple(length=10):
    l = []
    for i in range(length):
        l.append(random.choice(string.letters+string.digits))
    return string.join(l, '')

greekNames = ('alpha', 'beta', 'gamma', 'delta', 'epsilon', 'zeta', 'eta',
'theta', 'iota', 'kappa', 'lambda', 'mu', 'nu', 'xi', 'omicron', 'pi', 'rho',
'sigma', 'tau', 'upsilon', 'phi', 'chi', 'psi', 'omega')

syllables = """
    ak ek ik ok uk ag eg ig og ug al el il ol ul an en in on un
    at et it ot ut
    az iz ez oz uz azz izz ezz ozz uzz
    kar kur kul kor kas
    ral rel
    lok luk las lug
    mak mok mas mos mag mog
    ga gul ger
    tha the thi tho thu
    ug ig og ag eg
    sni sna snu
    fer fi fir fru fri for
    por per
    erl lep
    zen zun zin zan zon
    naz nez niz noz nuz
    ard ich ald
    ber
    s
    t
""".strip().split()

def kuruk():
    """ Generate a silly name based on the 'kuruk' syllables.
    """

    numsyl = random.randint(2,4)
    namesyl = []

    for i in range(numsyl):
        new = random.choice(syllables)
        while new in namesyl:
            new = random.choice(syllables)
        namesyl.append(new)
    name = ''.join(namesyl).capitalize()

    if not random.randint(0,1) and numsyl < 4:
        numsyl = random.randint(1,3)
        namesyl = []
        for i in range(numsyl):
            new = random.choice(syllables)
            while new in namesyl:
                new = random.choice(syllables)
            namesyl.append(new)
        name = name + " " + ''.join(namesyl).capitalize()

    return name

if __name__ == "__main__":
    for i in range(20):
        print kuruk()

